using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using NHibernate.Mapping.Attributes;
using Lib;

namespace Persistance.Model
{


    ///<summary>
    /// User Object Specification
    ///
    /// UserID (int) --> The unique ID associated with this user.
    /// FullName (varchar) --> The Fullname of the user. Decided to store this for convenience sake.
    /// SecurityLevel (int) --> A number between 1 and 30 to denote the users security clearance. Left a lot of room in case different user types are added in the future.
    ///</summary>

    [Serializable]
    [Class(Lazy = true)]
    public class ApplicationLog
    {
        #region " Mapping "

        /// <summary>
        /// This is needed for NH. NH only accepts numeric primary keys
        /// </summary>
        private int _applicationLogID;
        //NHIBER: Setts the primary key to ID
        [Id(Name = "ApplicationLogID")]
        [Generator(1, Class = "native")]
        public virtual int ApplicationLogID
        {
            get { return _applicationLogID; }
            set { _applicationLogID = value; }
        }

        /// <summary>
        /// Candidate key. Represents the unique username of the user
        /// </summary>
        private string _userName;
        [Property(Length = 256)]
        public virtual string UserName
        {
            get { return _userName; }
            set { _userName = value; }
        }

        private DateTime _dateCreated;
        [Property(Type = "DateTime", NotNull = true)]
        public virtual DateTime DateCreated
        {
            get { return _dateCreated; }
            set { _dateCreated = value; }
        }

        private string _explaination;
        [Property(Type = "StringClob", Length = 5000)]
        public virtual string Explaination
        {
            get { return _explaination; }
            set { _explaination = value; }
        }

        private LogEntryType _logEntryType;
        [OneToOne(ClassType = typeof(LogEntryType))]
        public virtual LogEntryType LogEntryType
        {
            get { return _logEntryType; }
            set { _logEntryType = value; }
        }

        #endregion
    }
    //categories, status and user FK
}
